package com.zh.freechat.domain.message.repository.real;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zh.freechat.domain.message.entity.GroupMemberPO;
import com.zh.freechat.domain.user.entity.GroupRelId;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author ZH
 * @date 23:21 2021/5/15
 */
@Mapper
public interface GroupMemberPoMapper extends BaseMapper<GroupMemberPO> {

    @Select(value = "SELECT group_id as id, GROUP_CONCAT(user_id) AS user_ids FROM ch_group_member WHERE group_id is not null GROUP BY group_id")
    List<GroupRelId> findRelIdAll();

}
